package com.sincon.system.service.impl;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import com.sincon.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sincon.system.mapper.TbVideoCommandMapper;
import com.sincon.system.domain.TbVideoCommand;
import com.sincon.system.service.ITbVideoCommandService;

/**
 * 视频关联指令Service业务层处理
 * 
 * @author LaoGao
 * @date 2024-12-23
 */
@Service
public class TbVideoCommandServiceImpl implements ITbVideoCommandService 
{
    @Autowired
    private TbVideoCommandMapper tbVideoCommandMapper;

    /**
     * 查询视频关联指令
     * 
     * @param id 视频关联指令主键
     * @return 视频关联指令
     */
    @Override
    public TbVideoCommand selectTbVideoCommandById(Long id)
    {
        return tbVideoCommandMapper.selectTbVideoCommandById(id);
    }

    /**
     * 查询视频关联指令列表
     * 
     * @param tbVideoCommand 视频关联指令
     * @return 视频关联指令
     */
    @Override
    public List<TbVideoCommand> selectTbVideoCommandList(TbVideoCommand tbVideoCommand)
    {

        return tbVideoCommandMapper.selectTbVideoCommandList(tbVideoCommand);
    }

    /**
     * 新增视频关联指令
     * 
     * @param tbVideoCommand 视频关联指令
     * @return 结果
     */
    @Override
    public int insertTbVideoCommand(TbVideoCommand tbVideoCommand)
    {
        SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        tbVideoCommand.setCreateName(SecurityUtils.getUsername());
        tbVideoCommand.setCreateTime(s.format(new Date()));
        return tbVideoCommandMapper.insertTbVideoCommand(tbVideoCommand);
    }

    /**
     * 修改视频关联指令
     * 
     * @param tbVideoCommand 视频关联指令
     * @return 结果
     */
    @Override
    public int updateTbVideoCommand(TbVideoCommand tbVideoCommand)
    {
        return tbVideoCommandMapper.updateTbVideoCommand(tbVideoCommand);
    }

    /**
     * 批量删除视频关联指令
     * 
     * @param ids 需要删除的视频关联指令主键
     * @return 结果
     */
    @Override
    public int deleteTbVideoCommandByIds(Long[] ids)
    {
        return tbVideoCommandMapper.deleteTbVideoCommandByIds(ids);
    }

    /**
     * 删除视频关联指令信息
     * 
     * @param id 视频关联指令主键
     * @return 结果
     */
    @Override
    public int deleteTbVideoCommandById(Long id)
    {
        return tbVideoCommandMapper.deleteTbVideoCommandById(id);
    }
}
